import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from 'src/common/entities/base.entity';

@Entity('sys_menu', { schema: 'lvlu', comment: '菜单表' })
export class Menu extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'menu_id' })
  menuId: number;

  @Column({
    type: 'varchar',
    name: 'menu_name',
    length: 50,
    comment: '菜单名称',
  })
  menuName: string;

  @Column({ type: 'int', name: 'parent_id', nullable: true, comment: '父级id' })
  parentId: number | null;

  @Column({
    type: 'varchar',
    name: 'permission',
    length: 50,
    nullable: true,
    comment: '权限标识',
  })
  permission: string | null;

  @Column({
    type: 'varchar',
    name: 'route',
    length: 100,
    nullable: true,
    comment: '路由路径',
  })
  route: string | null;

  @Column({
    type: 'varchar',
    name: 'component',
    length: 100,
    nullable: true,
    comment: '组件路径',
  })
  component: string | null;

  @Column({
    type: 'varchar',
    name: 'icon',
    length: 50,
    nullable: true,
    comment: '图标',
  })
  icon: string | null;

  @Column({
    type: 'char',
    name: 'visible',
    length: 1,
    nullable: true,
    comment: '显示状态 0:隐藏 1:显示',
  })
  visible: string | null;

  @Column({
    type: 'int',
    name: 'menu_type',
    nullable: true,
    comment: '类型 0:目录 1:菜单 2:按钮',
  })
  menuType: number | null;

  @Column({ type: 'int', name: 'sort', nullable: true, comment: '排序' })
  sort: number | null;
}
